﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class EnergyBeans : MonoBehaviour {

    public Sprite lightBean;
    public Sprite darkBean;

    public SpriteRenderer[] beans;
    public GameObject selfmark;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
    public void isMySelf(bool isme)
    {
        selfmark.SetActive(isme);
    }
    public void setBeans(int num,int maxnum)
    {
        for(int i=0;i < beans.Length;i++)
        {
            beans[i].gameObject.SetActive(i < maxnum);
            if (i < num)
                beans[i].sprite = lightBean;
            else
                beans[i].sprite = darkBean;
        }
    }
}
